import common from "./common";

export default {

    addCommands() {
        Cypress.Commands.add("typeFormControl",
            {
                prevSubject: 'optional'
            },
            (subject: Cypress.Chainable<any>, formControlName: string, value: string): Cypress.Chainable<any> => {
                return common
                    .selectNode(subject, "gn-form-field[label='" + formControlName + "']")
                    .find("input").type(value);
            });

        Cypress.Commands.add("clickCheckBox",
            {
                prevSubject: 'optional'
            },
            (subject: Cypress.Chainable<any>, text: string, value: string): Cypress.Chainable<any> => {
                return common.selectNode(subject, "mat-checkbox:contains('" + text + "')").click();
            });
    }

}
